The present invention relates to a focus detection apparatus for a camera which detects an in-focus condition of a photographing lens on the basis of a phase difference scheme.
Conventional focus detection systems used for auto-focus (automatic focus control) cameras employ a phase difference or contrast scheme, two focusing portions are formed on an image sensor by light reflected by an object, and an in-focus position is detected on the basis of a phase difference between electrical signals from the focusing portions of the image sensor.
FIGS. 11(a)-(c) are views showing the principle of focus detection according to a prior art phase difference scheme employed in a single-lens reflex camera. In the in-focus state shown in FIG. 11(a), light reflected by an object P is focused on a film equivalent plane 2 through a photographing lens 1 and is split by separator lenses 3 into two light components which are then focused again at points a0, b0 on an image sensor 4. In a near-focus state shown in FIG. 11(b), the images are focused on the image sensor 4 at points a1 and b1 inside the points a0 and b0, points a0 and b0 representing the in-focus state. In a far-focus state shown in FIG. 11(c), the images are focused on the image sensor 4 at positions represented by points a2 and b2 outside the in-focus state points a0 and b0. FIGS. 12(a), 12(b), and 12(c) show in-, near-, and far-focus image signals output from the image sensor 4. As is apparent from FIGS. 11(a)-11(c) and 12(a)-12(c), the refocusing positions in the near- and far-focus states differ from those in the in-focus state. Assume that a distance between the images at points a0 and b0 in the in-focus state is defined as l0, that a distance between the images at points a1 and b1 in the near-focus state is defined as l1, and that a distance between the images at points a2 and b2 in the far-focus state is defined as l2. Defocus amounts d1 and d2 are defined as a function of image distances l1 and l2 shown in FIGS. 12(b) and 12(c). The defocus amount can be obtained on the basis of the image distance by using predetermined equations. When the photographing lens is moved by a distance represented by the defocus amount, the in-focus state in the camera can be achieved.
FIG. 13 is a block diagram of a conventional focus detection apparatus (shown in unexamined Japanese Patent Publication (Kokai) Nos. 59-140409, 60-101516, and 61-35413, the entire contents of which are incorporated hereby by reference) for carrying out the phase difference scheme described above. Phase detection type automatic focusing camera systems are generally well known, as shown by the article entitled "Autofocus Hocus-Pocus", Popular Science, March, 1988, the entire contents of which are incorporated herein by reference.
Referring to the prior art system of FIG. 13, CCD 5 (Charge-Coupled Device) serves as an image sensor and comprises a photodiode array, control gates, and a shift register, and is adapted to output an image signal having an amplitude proportional to the intensity of light from an object. A monitor element 6 is arranged near the CCD 5 and is adapted to output a monitor signal proportional to a charging level of the CCD 5. A CCD driver 7 is provided for outputting a drive pulse to the CCD 5, and a differential amplifier 8 amplifies an image signal from the CCD 5 to have a sufficient level so as to be subjected to A/D conversion in A/D converter 11. A monitor circuit 9 is provided for outputting a predetermined gain signal to the differential amplifier 8 and an accumulation stop signal to a microcomputer 10 when a monitor signal output from the monitor element 6 reaches a predetermined value. The A/D converter 11 converts the amplified image signal from CCD 5 into quantized data.
In operation, when a clear pulse is output from the CCD driver 7 to the CCD 5 and the monitor element 6, the photodiode array in the CCD 5 and the monitor element 6 are completely discharged. Thereafter, new charges are accumulated in the CCD 5 and the monitor element 6 in proportion to the brightness of the object being viewed. When a monitor signal output from the monitor element 6 reaches a predetermined reference value (i.e., a predetermined charge is accumulated), as detected by the monitor circuit 9, an accumulation stop signal is supplied from the monitor circuit 9 to the microcomputer 10 and the microcomputer 10 sends a stop signal to the CCD driver 7, thereby causing the CCD driver 7 to output a shift pulse to the CCD 5 and hence cause shifting of the accumulated charges from the CCD 5 to the not-shown shift register (which is part of the CCD 5). The shifted charges are output as an image signal to the differential amplifier 8. A dark output component of the CCD 5 is subtracted from the image signal input to the differential amplifier 8. The resultant signal is amplified by the differential amplifier 8 with a predetermined gain, as set by a gain signal supplied from the monitor circuit 9. The gain varies according to the object brightness detected by the monitor element 6. For example, if the object is bright, the image signal is processed at a gain of 1 (gain of differential amplifier). However, if the object is dark, the image signal is processed at a gain of, for example, 2, 4, or 8 (gain of differential amplifier) in accordance with the intensity level of the image signal. Subsequently, after amplification by the differential amplifier 8, the image signal is converted into a digital image signal by the A/D converter 11, and the resulting digital image signal is input to the microcomputer 10. The microcomputer 10 calculates a defocus amount from the digital image signal in accordance with preset data and predetermined programs which are known in the art. The microcomputer 10 outputs a drive signal to a lens actuator 30. The lens actuator 30 drives the photographing lens 40 by a distance corresponding to the defocus amount, to focus the lens on the objects, thereby completing the focusing operation.
The monitor element 6 is located near the CCD 5 such that the width of the monitor element 6 assures detection of average luminance of the object image. The CCD 5 is charged within a charge accumulation period corresponding to the average luminance. In general, even if different objects have identical average luminance levels, the levels of contrast between the brightest and darkest portions of the objects differ from each other. In a conventional apparatus, a single gain (i.e., of differential amplifier 8) is used to process the image signals from the CCD 5 if they have identical average luminance levels regardless of contrast levels. For this reason, in the prior art system, if the object is sufficiently bright but has a low contrast level, accurate focusing cannot be detected, resulting in improper focusing and inconvenience. For example, assume that an object such as an object having a bright linear pattern on a whitish wall has a high brightness level and a low contrast level. An image signal from the CCD 5 is provided, as shown in FIG. 14. Since the average luminance level of the image signal of the object is sufficiently high, the conventional apparatus processes the image signal at a gain of 1. However, since a bump A in a curve representing the image signal is very small, a defocus amount on the basis of the phase difference described above cannot be accurately calculated (for example, a change in bump A occurs within a bit error).
The present invention has been made in consideration of the above situation, and has as its object to perform accurate focus detection regardless of contrast levels of the object.